Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Load plugins when starting a GHC session #905

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

mpickering
Copy link
Collaborator

Fixes #900

This also needs to be backported to the ghc-8.6 branch.

@mpickering
Copy link
Collaborator Author

Is anything blocking this patch? @alexbiehl @harpocrates ?

@alexbiehl
Copy link
Member

Sorry, just me not noticing the notifications..

@alexbiehl alexbiehl merged commit 72d82e5 into haskell:ghc-head Aug 21, 2018
alexbiehl pushed a commit that referenced this pull request Aug 21, 2018
bgamari pushed a commit to bgamari/haddock that referenced this pull request Aug 21, 2018
@sheaf
Copy link
Contributor

sheaf commented Oct 22, 2018

This fix doesn't seem to work on Windows. I'm afraid that even with verbose output, there are no meaningful error messages (I've attached the output anyway).
(Note that I had to patch GHC 8.6.1 for plugins to work on Windows, see GHC trac #15700.)

cabal new-haddock output, with GHC 8.6.1

@harpocrates
Copy link
Collaborator

This fix doesn't seem to work on Windows. I'm afraid that even with verbose output, there are no meaningful error messages (I've attached the output anyway).

Yeah, the -v3 is something that cabal doesn't end up threading to Haddock (perhaps it should...). However, I doubt that the verbose output is all that useful - the failure is surely happening in typecheckModule 😄.

Unfortunately I don't have a Windows machine with which to debug...

@sheaf
Copy link
Contributor

sheaf commented Oct 22, 2018

At first, I thought it boiled down to the fact that, when running haddock, the call to initializePlugins (from ghc/compiler/main/DynamicLoading.hs) determines that no loading needs to take place.
When running e.g. cabal new-repl or cabal new-build, the call to initializePlugins would reload plugins, whereas with cabal new-haddock, it would follow the code path which did not reload anything.

However, after modifying the code to force cabal new-haddock to always reload plugins, the problem persists. Let me know what I should be looking for in typecheckModule and I'll try to keep digging.

harpocrates added a commit to harpocrates/haddock that referenced this pull request Dec 20, 2018
harpocrates added a commit to harpocrates/haddock that referenced this pull request Dec 20, 2018
harpocrates added a commit that referenced this pull request Dec 20, 2018
* WIP: Load (typechecker) plugins from language pragmas

* Revert "Load plugins when starting a GHC session (#905)"

This reverts commit 72d82e5.

* Simplify plugin initialization code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants